--
-- PostgreSQL database dump
--

-- Dumped from database version 9.0.3
-- Dumped by pg_dump version 9.0.3
-- Started on 2011-05-25 11:00:53

SET statement_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = off;
SET check_function_bodies = false;
SET client_min_messages = warning;
SET escape_string_warning = off;

--
-- TOC entry 316 (class 2612 OID 11574)
-- Name: plpgsql; Type: PROCEDURAL LANGUAGE; Schema: -; Owner: postgres
--

CREATE OR REPLACE PROCEDURAL LANGUAGE plpgsql;


ALTER PROCEDURAL LANGUAGE plpgsql OWNER TO postgres;

SET search_path = public, pg_catalog;

SET default_tablespace = '';

SET default_with_oids = false;

--
-- TOC entry 1511 (class 1259 OID 19052)
-- Dependencies: 1791 1792 5
-- Name: dailysale; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE dailysale (
    code character varying(50) NOT NULL,
    item_type character varying(1) NOT NULL,
    bill_numner numeric NOT NULL,
    item_code character varying(50) NOT NULL,
    item_name character varying(255),
    quantity double precision DEFAULT 0,
    unit_price double precision DEFAULT 0,
    create_user_name character varying(50),
    create_date character varying(10),
    create_time character varying(10),
    update_user_name character varying(50),
    update_date character varying(10),
    update_time character varying(10)
);


ALTER TABLE public.dailysale OWNER TO postgres;

--
-- TOC entry 1509 (class 1259 OID 19002)
-- Dependencies: 1789 1790 5
-- Name: item; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE item (
    code character varying(50) NOT NULL,
    name character varying(255),
    "desc" character varying(255),
    unit_price double precision DEFAULT 0,
    uom_code character varying(50),
    uom_name character varying(255),
    parent_item_code character varying(255) DEFAULT 'no_code'::character varying NOT NULL,
    create_user_name character varying(50),
    create_date character varying(10),
    create_time character varying(10),
    update_user_name character varying(50),
    update_date character varying(10),
    update_time character varying(10)
);


ALTER TABLE public.item OWNER TO postgres;

--
-- TOC entry 1510 (class 1259 OID 19018)
-- Dependencies: 5
-- Name: uom; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE uom (
    code character varying(50) NOT NULL,
    name character varying(255),
    "desc" character varying(255),
    create_user_name character varying(50),
    create_date character varying(10),
    create_time character varying(10),
    update_user_name character varying(50),
    update_date character varying(10),
    update_time character varying(10)
);


ALTER TABLE public.uom OWNER TO postgres;

--
-- TOC entry 1508 (class 1259 OID 18997)
-- Dependencies: 5
-- Name: user; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE "user" (
    user_name character varying(50) NOT NULL,
    password character varying(50),
    full_name character varying(255)
);


ALTER TABLE public."user" OWNER TO postgres;

--
-- TOC entry 1804 (class 0 OID 19052)
-- Dependencies: 1511
-- Data for Name: dailysale; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY dailysale (code, item_type, bill_numner, item_code, item_name, quantity, unit_price, create_user_name, create_date, create_time, update_user_name, update_date, update_time) FROM stdin;
\.


--
-- TOC entry 1802 (class 0 OID 19002)
-- Dependencies: 1509
-- Data for Name: item; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY item (code, name, "desc", unit_price, uom_code, uom_name, parent_item_code, create_user_name, create_date, create_time, update_user_name, update_date, update_time) FROM stdin;
\.


--
-- TOC entry 1803 (class 0 OID 19018)
-- Dependencies: 1510
-- Data for Name: uom; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY uom (code, name, "desc", create_user_name, create_date, create_time, update_user_name, update_date, update_time) FROM stdin;
\.


--
-- TOC entry 1801 (class 0 OID 18997)
-- Dependencies: 1508
-- Data for Name: user; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY "user" (user_name, password, full_name) FROM stdin;
\.


--
-- TOC entry 1800 (class 2606 OID 19061)
-- Dependencies: 1511 1511
-- Name: dailysale_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY dailysale
    ADD CONSTRAINT dailysale_pkey PRIMARY KEY (code);


--
-- TOC entry 1796 (class 2606 OID 19051)
-- Dependencies: 1509 1509 1509
-- Name: item_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY item
    ADD CONSTRAINT item_pkey PRIMARY KEY (code, parent_item_code);


--
-- TOC entry 1798 (class 2606 OID 19025)
-- Dependencies: 1510 1510
-- Name: uom_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY uom
    ADD CONSTRAINT uom_pkey PRIMARY KEY (code);


--
-- TOC entry 1794 (class 2606 OID 19001)
-- Dependencies: 1508 1508
-- Name: user_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY "user"
    ADD CONSTRAINT user_pkey PRIMARY KEY (user_name);


--
-- TOC entry 1809 (class 0 OID 0)
-- Dependencies: 5
-- Name: public; Type: ACL; Schema: -; Owner: postgres
--

REVOKE ALL ON SCHEMA public FROM PUBLIC;
REVOKE ALL ON SCHEMA public FROM postgres;
GRANT ALL ON SCHEMA public TO postgres;
GRANT ALL ON SCHEMA public TO PUBLIC;


-- Completed on 2011-05-25 11:00:53

--
-- PostgreSQL database dump complete
--

